package com.xhs.controller;

import com.xhs.dto.request.TableParams;
import com.xhs.message.ReturnResult;
import com.xhs.service.CreateTableService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @desc: 动态创建表结构
 * @projectName: spring-boot-demo
 * @author: xhs
 * @date: 2023-10-11 011 20:23
 * @version: JDK 1.8
 */
@RestController
public class CreateTableController {
    @Resource
    private CreateTableService createTableService;

    /**
     * 创建表结构
     *
     * @param tableParams 入参
     * @return ReturnResult<Object>
     */
    @PostMapping("/createTable")
    public ReturnResult<Object> createTable(@RequestBody TableParams tableParams) {
        return createTableService.createTable(tableParams);
    }
}
